package cn.s1995.sloth.bizs.entity;

import cn.s1995.sloth.common.core.convert.JoinUrlPrefixConvert;
import cn.s1995.sloth.bizs.entity.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * 订单项
 *
 * @author sloth
 * @date 2023-12-15 15:31:58
 */
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(description = "订单项")
@TableName("biz_order_item")
public class OrderItem extends BaseEntity {


	/**
	* ID
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "ID")
    private Long id;

	/**
	* 订单id
	*/
    @Schema(description = "订单id")
    private Long orderId;

	/**
	* 用户id
	*/
    @Schema(description = "用户id")
    private Long uid;

	/**
	* 店铺id
	*/
    @Schema(description = "店铺id")
    private Long shopId;

	/**
	* 产品id
	*/
    @Schema(description = "产品id")
    private Long prodId;

	/**
	* sku id
	*/
    @Schema(description = "sku id")
    private Long skuId;

	/**
	* 产品名称
	*/
    @Schema(description = "产品名称")
    private String prodName;

	/**
	* sku名称
	*/
    @Schema(description = "sku名称")
    private String skuName;

	/**
	* 图片
	*/
    @JsonSerialize(using = JoinUrlPrefixConvert.class)
    @Schema(description = "图片")
    private String pic;

	/**
	* 金额
	*/
    @Schema(description = "产品单价")
    private BigDecimal amount;

	/**
	* 数量
	*/
    @Schema(description = "数量")
    private Integer num;

	/**
	* 运费
	*/
    @Schema(description = "订单明细项的运费")
    private BigDecimal freightAmount;

	/**
	* 总金额
	*/
    @Schema(description = "明细项总金额（不含运费） subtotal")
    private BigDecimal totalAmount;

	/**
	* 发货周期
	*/
    @Schema(description = "发货周期")
    private Integer deliveryCycle;

	/**
	* 是否评价
	*/
    @Schema(description = "是否评价")
    private Boolean isComment;
}
